package com.coin.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.coin.domain.Config;
import com.coin.mapper.ConfigMapper;
import com.coin.service.ConfigService;
import org.springframework.stereotype.Service;

/**
 * @author 李力
 * @description 针对表【config(平台配置信息)】的数据库操作Service实现
 * @createDate 2025-06-13 17:22:08
 */
@Service
public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config>
        implements ConfigService {

    @Override
    public Config getConfigByCode(String code) {
        LambdaQueryWrapper<Config> wrapper = new LambdaQueryWrapper<>();
        wrapper = wrapper.eq(StrUtil.isNotEmpty(code), Config::getCode, code);
        return getOne(wrapper);
    }
}




